

public class iptables {
	public static void main(String[] args) {
	}

	static void ip(String ip, String port1, String port2) {
		String s = "iptables -I FORWARD -p tcp --dport " + port2 + " -j ACCEPT";
		System.out.println(s);
		String s1 = "iptables -t nat -I PREROUTING -p tcp --dport " + port1 + " -j DNAT --to " + ip + ":" + port2;
		System.out.println(s1);
		String s2 = "iptables -t nat -I POSTROUTING -p tcp --dport " + port2 + " -j MASQUERADE";
		System.out.println(s2);
	}

}
